#ifndef P1_H
#define P1_H
#include <iostream>
#include <vector> 
#include <fstream>
#include <stdlib.h>
#include <sstream>
#include <iterator>
#include <algorithm>
#include <stdint.h>
#include <cstdlib>
#include <ctime>

#define ITER 10

#ifdef __amd64
inline uint64_t rdtsc(){
	uint32_t lo, hi;
	__asm__ __volatile__ (
	"xorl %%eax, %%eax\n"
	"cpuid\n"
	"rdtsc\n"
	: "=a" (lo), "=d" (hi)
	:
	: "%ebx", "%ecx" );
	return (uint64_t)hi << 32 | lo;
}
#endif


using namespace std;


struct triplet{
	int numero;
	int carga;
	int produccion;

	triplet(){}
	triplet(int i, int j, int k):numero(i),carga(j),produccion(k){}

	bool operator<(const triplet& t) const{
		if (produccion > t.produccion){
			return true;
		}
		return false;
	}
};
ostream& operator<<(ostream& os, const triplet& t);
vector<triplet> cargar(istringstream& is);
void resolver(vector<triplet>& v);
void salida(ostream& out, vector<triplet>& p);
void generarInstancias();

#endif // P1_H
